<!DOCTYPE html>
<html>
<head>
<title>用户抽奖记录</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../../include/resources.html">
<script type="text/javascript">
    var dataGrid;
   
    $(function() {
        dataGrid = $('#dataGrid').datagrid({
            url : '/modules/additional/drawLottery/lotteryRecordList.html',
            fit : true,
            fitColumns : true,
            border : false,
            pagination : true,
            idField : 'id',
            pageSize : pageSize,
            pageNums :1,
            pageList : pageList,
            sortName : 'id',
            sortOrder : 'asc',
            checkOnSelect : false,
            selectOnCheck : false,
            nowrap : false,
			singleSelect:true,
            columns:[[
                { field: 'id', title: '编号', width: 50, sortable:false }, 
                { field: 'name', title: '名称', width: 80, sortable:false },
                { field: 'category', title: '抽奖类别', width: 80, sortable:false,
                    formatter: function(value,row,index){
                        if(row.category==1){
                            return "积分抽奖";
                        }else if(row.category==2){
                            return "签到抽奖";
                        }
                    }
                },
                { field: 'userName', title: '用户名', width: 80, sortable:false },
                { field: 'type', title: '奖品类型', width: 80, sortable:false,
                    formatter: function(value,row,index){
                        if(value==1){
                            return "积分";
                        }else if(value==2){
                            return "现金";
                        }else if(value==3){
                            return "加息券";
                        }else if(value==4){
                            return "抽奖";
                        }else if(value==5){
                            return "电影票";
                        } else if(value==6){
                            return "现金红包";
                        }else if(value==7){
                            return "体验券";
                        }else if(value==8){
                            return "实物";
                        }else if(value==9){
                            return "投资红包";
                        }else{
                            return "未中奖";
                        }
                    }
                },
                { field: 'value', title: '获奖结果', width: 100, sortable:false,
            	  	formatter: function(value,row,index){
            	  		if(value == 0 && row.type!=8){
            	  			return '未中奖';
            	  		}else{
            	  			if(row.type == 1){
            	  				return value+'积分';
            	  			}else if(row.type == 2){
            	  				return value+'元';
            	  			}else if(row.type == 3){
                                return value+'额度加息券';
                            }else if(row.type == 4){
                                return value+'次抽奖';
                            }else if(row.type == 5){
                                return value+'张电影票';
                            }else if(row.type == 6){
                                return value+'元现金红包';
                            }else if(row.type == 7){
                                return value+'元体验金';
                            }else if(row.type == 8){
                                return row.name;
                            }else if(row.type == 9){
                                return value+'元投资红包';
                            }
            	  		}
            		}   
                },   
                { field: 'addTime', title: '添加时间', width: 100, sortable:false,
               	  	formatter: function(value,row,index){
               	  		return getLocalTime(value,4);
               		}
                },
            ] ],
            toolbar : '#toolbar',
            onLoadSuccess : function() {
                $('#searchForm table').show();
                parent.$.messager.progress('close');
            }
        });
    });
</script>
</head>
<body style="padding:0 20px;" >
	<div class="easyui-layout" data-options="fit : true,border : false">
        <div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        	<div class="sLeft">
	            <form id="searchForm" autocomplete="off">
	            	<input type="text" id="searchName" name="searchName" class="sInput" placeholder="输入中奖名称进行搜索"  onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
	            	<a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
            <form id="showAdw">
		        <ul class="showAdw" style="display:none;">
		        	<a href="javascript:void(0);"><i class="iconfont closeWin">&#xe628;</i></a>
		        	<li><span>名称</span><input type="text" name="name" id="name" autocomplete="off"/></li>
		        	<li><span>奖品类型</span><select id="type" name="type" class="type">
							<option value="99">全部</option>
							<option value="1">积分</option>
							<option value="2">现金</option>
                            <option value="3">加息券</option>
                            <option value="4">抽奖</option>
                            <option value="5">电影票</option>
                            <option value="6">现金红包</option>
                            <option value="9">投资红包</option>
                            <option value="7">体验金</option>
                            <option value="8">实物</option>
						</select></li>
		        	<li><span>添加时间</span><input type="text" name="startTime" id="startTime" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',readOnly:true})" class="searchTime"/>&nbsp;-&nbsp;<input type="text" name="endTime" id="endTime" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',readOnly:true})" class="searchTime"/></li>
		       		<li><span></span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
		        </ul>
	        </form>
        </div>
        <div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
            <table id="dataGrid"></table>
        </div>
    </div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>
